# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=backports.shutil_get_terminal_size
pkgbase=mingw-w64-python2-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}")
pkgver=1.0.0
pkgrel=1
pkgdesc="The get_terminal_size() function from Python 3.3 (mingw-w64)"
arch=('any')
license=('MIT')
url="https://pypi.python.org/pypi/backports.ssl_match_hostname"
depends=("${MINGW_PACKAGE_PREFIX}-python2-backports")
source=("${_realname}-${pkgver}.tar.gz::https://github.com/chrippa/backports.shutil_get_terminal_size/archive/v${pkgver}.tar.gz")
sha256sums=('ebeddf414a973f6b1c08c35892a8c5330aa9368171d9f70d749909525d72c9f1')

package() {
  cd "${srcdir}"/${_realname}-${pkgver}
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=;--install-purelib=;--install-data=" \
    ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=0
  rm "${pkgdir}${MINGW_PREFIX}/lib/python2.7/site-packages/backports/__init__.py"*
  install -D -m644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE"
}
